package test.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectInputStream02 {
	public static void main(String[] args) {
		ObjectInputStream ois=null;
		try{
			ois=new ObjectInputStream(new FileInputStream("per.dat"));
			Person obj=(Person)ois.readObject();
			System.out.println(obj);
			obj.show();
		}catch(FileNotFoundException fe){
			System.out.println(fe.getMessage());
		}catch(IOException ie){
			System.out.println(ie.getMessage());
		}catch(ClassNotFoundException ce){
			System.out.println(ce.getMessage());
		}finally{
		
			try{
				if(ois!=null) ois.close();
			}catch(IOException ie){}
		}
	}
}
